package com.ttxs.generator.output.other;

import com.ttxs.generator.engine.CustomFreemarker;
import com.ttxs.generator.output.Output;
import com.ttxs.generator.util.PathUtils;

import java.io.File;
import java.io.IOException;

public class ApplicationYml implements Output {
    @Override
    public void write(CustomFreemarker templateEngine) throws IOException {
        String resourcesPath = PathUtils.get(PathUtils.Java.resources, templateEngine.formBean().getJavaProjectPath());
        File applicationYml = new File(resourcesPath + File.separator + "application.yml");
        templateEngine.outputFile(applicationYml, templateEngine.customMap(), "templates/application.yml.ftl");
    }
}
